function[]=zadanibivar(akce)
%ZADANIBIVAR  calls up a window for editting smoothing parameters
%
%     Use only in procedure KERN
%
% (C) Jan Kolacek, Masaryk University (Czech Republic)

if nargin<1
    akce='inic';
end;
echo off;
if strcmp(akce,'inic')
    %    n=0;k=2;m=1;h=0.1;
    %    save v h -append;
    
    figNumber=figure(...
        'Visible','off', ...
        'Units','normalized',...
        'Name','EDIT', ...
        'Color',[.3 .3 .3],...
        'Tag','kclos',...
        'NumberTitle','off');
    
    save v figNumber -append;
    % First, the MiniCommand Window frame
    
    prevFig=findobj(0,'name','KERNEL SMOOTHING');
    prevG=get(prevFig,'UserData');
    if ~isempty(prevG.dens)
        rozhzpus='on';
    else
        rozhzpus='off';
    end
    
    if ~isempty(prevG.sigma)
        rozhzpusmise='on';
    else
        rozhzpusmise='off';
    end
    
    uicontrol( ...
        'Style','frame', ...
        'Units','normalized', ...
        'FontUnits','normalized',...
        'Position',[.03,0.56,.3,.41], ...
        'BackgroundColor',[0.50 0.50 0.50]);
    
    % Radio1
    
    c1='G=get(gcf,''UserData'');hL=G.hndlList;set(hL(7),''value'',0);';
    c2=['val=get(hL(5),''Value'');if val==1,G.styl=''prod'';',...
        'set(G.hndlList(14:17),''Enable'',''on'');set(G.hndlList([19,20,22,23]),''Enable'',''off'');',...
        'else,G.styl=''sphe'';set(G.hndlList([14:17,19,20,22,23]),''Enable'',''off'');end;set(G.hndlList(18),''Enable'',G.rozh);set(gcf,''UserData'',G);'];
    c3='set(hL([1:3,5,6]),''Enable'',''on'');set(hL(4),''value'',1);';
    rad1Hndl=uicontrol( ...
        'Style','radiobutton', ...
        'Enable','on',...
        'Units','normalized', ...
        'FontUnits','normalized',...
        'Position',[.05,.9,.26,.05], ...
        'BackgroundColor',[0.5 0.5 0.5], ...
        'Callback',[c1,c2,c3],...
        'String','Polynomial Kernel');
    
    % Then the text label
    
    uicontrol( ...
        'Style','text', ...
        'Units','normalized', ...
        'FontUnits','normalized',...
        'Position',[.08,.82,.08,.05], ...
        'BackgroundColor',[0.50 0.50 0.50], ...
        'ForegroundColor',[1 1 1], ...
        'HorizontalAlignment','left',...
        'String','Set nu');
    
    % Generic popup button information
    nHndl=uicontrol( ...
        'Style','popup', ...
        'Units','normalized', ...
        'Enable','off',...
        'FontUnits','normalized',...
        'Position',[.15,.835,.16,.04], ...
        'String',num2str((0:20)'), ...
        'Callback','zadanibivar(''prac'');');
    
    
    % Then the text label
    
    uicontrol( ...
        'Style','text', ...
        'Units','normalized', ...
        'FontUnits','normalized',...
        'Position',[.08,.76,.08,.05], ...
        'BackgroundColor',[0.50 0.50 0.50], ...
        'ForegroundColor',[1 1 1], ...
        'HorizontalAlignment','left',...
        'String','Set k');
    % Generic popup button information
    kHndl=uicontrol( ...
        'Style','popup', ...
        'Units','normalized', ...
        'Enable','off',...
        'FontUnits','normalized',...
        'Position',[.15,.775,.16,.04], ...
        'String',num2str((2:22)'), ...
        'Callback','zadanibivar(''prac'');');
    
    % Then the text label
    
    uicontrol( ...
        'Style','text', ...
        'Units','normalized', ...
        'FontUnits','normalized',...
        'Position',[.08,.7,.08,.05], ...
        'BackgroundColor',[0.50 0.50 0.50], ...
        'ForegroundColor',[1 1 1], ...
        'HorizontalAlignment','left',...
        'String','Set mu');
    % Generic popup button information
    mHndl=uicontrol( ...
        'Style','popup', ...
        'Units','normalized', ...
        'FontUnits','normalized',...
        'Enable','off',...
        'Position',[.15,.715,.16,.04], ...
        'String',num2str((-1:20)'), ...
        'Callback','zadanibivar(''prac'');');
    
    % Then the text label
    uicontrol( ...
        'Style','text', ...
        'Units','normalized', ...
        'FontUnits','normalized',...
        'Position',[.05,.64,.26,.05], ...
        'BackgroundColor',[0.50 0.50 0.5], ...
        'FontSize',0.55,...
        'HorizontalAlignment','left',...
        'String','Set the type of kernel');
    
    c1='G=get(gcf,''UserData'');G.styl=''prod'';set(gcf,''UserData'',G);';
    c2='set(G.hndlList(6),''Value'',0);set(G.hndlList(5),''value'',1);';
    c3='set(G.hndlList(14:17),''Enable'',''on'');set(G.hndlList(18),''Enable'',G.rozh);set(G.hndlList([19,20,22,23]),''Enable'',''off'');';
    rad2Hndl=uicontrol( ...
        'Style','radiobutton', ...
        'Enable','off',...
        'Units','normalized', ...
        'FontUnits','normalized',...
        'Value',1,...
        'Position',[.08,.61,.2,.04], ...
        'BackgroundColor',[0.5 0.5 0.5], ...
        'Callback',[c1,c2,c3],...
        'String','Product');
    
    c1='G=get(gcf,''UserData'');G.styl=''sphe'';set(gcf,''UserData'',G);';
    c2='set(G.hndlList(5),''Value'',0);set(G.hndlList(6),''value'',1);';
    c3='set(G.hndlList([14:17,19,20,22,23]),''Enable'',''off'');set(G.hndlList(18),''Enable'',G.rozh);';
    rad3Hndl=uicontrol( ...
        'Style','radiobutton', ...
        'Enable','off',...
        'Units','normalized', ...
        'FontUnits','normalized',...
        'Position',[.08,.57,.21,.04], ...
        'BackgroundColor',[0.5 0.5 0.5], ...
        'Callback',[c1,c2,c3],...
        'String','Spherically Symmetric');
    
    % First, the MiniCommand Window frame
    
    uicontrol( ...
        'Style','frame', ...
        'Units','normalized', ...
        'FontUnits','normalized',...
        'Position',[.03,0.47,.3,.08], ...
        'BackgroundColor',[0.50 0.50 0.50]);
    
    c1='G=get(gcf,''UserData'');G.styl=''gaus'';set(gcf,''UserData'',G);hL=G.hndlList;set(hL(7),''value'',1);';
    c2='set(hL([1:3,5,6]),''Enable'',''off'');set(hL(4),''value'',0);set(G.hndlList(18),''Enable'',G.rozh);';
    c3='set(G.hndlList(14:17),''Enable'',''off'');set(G.hndlList(23),''Enable'',G.rozhmise);set(G.hndlList(19:22),''Enable'',''on'');';
    rad4Hndl=uicontrol( ...
        'Style','radiobutton', ...
        'Enable','on',...
        'Value',1,...
        'Units','normalized', ...
        'FontUnits','normalized',...
        'Position',[.05,.485,.26,.05], ...
        'BackgroundColor',[0.5 0.5 0.5], ...
        'Callback',[c1,c2,c3],...
        'String','Gaussian Kernel');
    
    
    % First, the MiniCommand Window frame
    
    uicontrol( ...
        'Style','frame', ...
        'Units','normalized', ...
        'FontUnits','normalized',...
        'Position',[.03,0.23,.3,.2], ...
        'BackgroundColor',[0.50 0.50 0.50]);
    
    % Then the text label
    
    uicontrol( ...
        'Style','text', ...
        'Units','normalized', ...
        'FontUnits','normalized',...
        'Position',[.05,.3,.08,.05], ...
        'BackgroundColor',[0.50 0.50 0.50], ...
        'ForegroundColor',[1 1 1], ...
        'String','Set H');
    
    uicontrol( ...
        'Style','text', ...
        'Units','normalized', ...
        'FontUnits','normalized',...
        'HorizontalAlignment','left',...
        'Position',[.112,.32,.03,.03], ...
        'BackgroundColor',[0.50 0.50 0.50], ...
        'ForegroundColor',[1 1 1], ...
        'FontSize',.5,...
        'String','2');
    
    % First, the MiniCommand Window frame
    
    uicontrol( ...
        'Style','frame', ...
        'Units','normalized', ...
        'FontUnits','normalized',...
        'Position',[.15,0.25,.16,.15], ...
        'BackgroundColor',[0.50 0.50 0.50]);
    
    uicontrol( ...
        'Style','text', ...
        'Units','normalized', ...
        'FontUnits','normalized',...
        'Position',[.16,.39,.14,.02], ...
        'BackgroundColor',[0.50 0.50 0.50]);
    uicontrol( ...
        'Style','text', ...
        'Units','normalized', ...
        'FontUnits','normalized',...
        'Position',[.16,.24,.14,.02], ...
        'BackgroundColor',[0.50 0.50 0.50]);
    
    %     uicontrol( ...
    % 	    'Style','text', ...
    %         'Units','normalized', ...
    %         'FontUnits','normalized',...
    %         'Position',[.145,.26,.04,.16], ...
    %         'BackgroundColor',[0.50 0.50 0.50], ...
    % 	    'HorizontalAlignment','left',...
    %         'FontSize',0.8,...
    %         'String','[');
    %     uicontrol( ...
    % 	    'Style','text', ...
    %         'Units','normalized', ...
    %         'FontUnits','normalized',...
    %         'Position',[.28,.26,.04,.16], ...
    %         'BackgroundColor',[0.50 0.50 0.50], ...
    % 	    'HorizontalAlignment','left',...
    %         'FontSize',0.8,...
    %         'String',']');
    
    %Then the editable text field
    h11Hndl=uicontrol( ...
        'Style','edit', ...
        'Units','normalized', ...
        'FontUnits','normalized',...
        'Max',1, ...
        'Min',1, ...
        'BackgroundColor',[.9 .9 .9], ...
        'Callback','zadanibivar(''prac'')' , ...
        'Position',[.175,.33,.05,.04], ...
        'String','0',...%%%%
        'HorizontalAlignment','left');
    
    h12Hndl=uicontrol( ...
        'Style','edit', ...
        'Units','normalized', ...
        'FontUnits','normalized',...
        'Max',1, ...
        'Min',1, ...
        'BackgroundColor',[.9 .9 .9], ...
        'Callback','zadanibivar(''prac'')' , ...
        'Position',[.235,.33,.05,.04], ...
        'String','0',...%%%%
        'HorizontalAlignment','left');
    
    h21Hndl=uicontrol( ...
        'Style','edit', ...
        'Units','normalized', ...
        'FontUnits','normalized',...
        'Max',1, ...
        'Min',1, ...
        'BackgroundColor',[.9 .9 .9], ...
        'Callback','zadanibivar(''prac'')' , ...
        'Position',[.175,.28,.05,.04], ...
        'String','0',...%%%%
        'HorizontalAlignment','left');
    
    h22Hndl=uicontrol( ...
        'Style','edit', ...
        'Units','normalized', ...
        'FontUnits','normalized',...
        'Max',1, ...
        'Min',1, ...
        'BackgroundColor',[.9 .9 .9], ...
        'Callback','zadanibivar(''prac'')' , ...
        'Position',[.235,.28,.05,.04], ...
        'String','0',...%%%%
        'HorizontalAlignment','left');
    
    symHndl=uicontrol( ...
        'Style','text', ...
        'Units','normalized', ...
        'Visible','off',...
        'FontUnits','normalized',...
        'Position',[.03,.15,.3,.07], ...
        'BackgroundColor',[0.30 0.30 0.30], ...
        'ForegroundColor',[0.6 0.2 0.2], ...
        'String','H should be symmetric!');
    
    psdHndl=uicontrol( ...
        'Style','text', ...
        'Units','normalized', ...
        'Visible','off',...
        'FontUnits','normalized',...
        'Position',[.03,.15,.3,.07], ...
        'BackgroundColor',[0.30 0.30 0.30], ...
        'ForegroundColor',[0.6 0.2 0.2], ...
        'String','H should be positive definite!');

% Then the text label
    
   evHndl = uicontrol( ...
	     'Style','text', ...
        'Units','normalized', ...
        'FontUnits','normalized',...
        'Position',[.03,.15,.3,.07], ...
        'BackgroundColor',[0.30 0.30 0.30], ...
	    'ForegroundColor',[0.6 0.2 0.2], ...
        'String','The sum nu+k should be even!');
set(evHndl,'Visible','off');

% Then the text label
    
   inqHndl = uicontrol( ...
	     'Style','text', ...
        'Units','normalized', ...
        'FontUnits','normalized',...
        'Position',[.03,.15,.3,.07], ...
        'BackgroundColor',[0.30 0.30 0.30], ...
	    'ForegroundColor',[0.6 0.2 0.2], ...
        'String','The inequality nu < k should be satisfied!');
set(inqHndl,'Visible','off');
    
    hlpstr=char(['Firstly set the order and the smoothness of the kernel, ',...
        'which will be used for kernel estimation. The kernel will be ',...
        'of order (nu,k), where nu+k should be even. For an estimation ',...
        'of a density use n = 0. The parameter mu is the ',...
        'smoothness of this kernel.'],['Finally set the bandwidth matrix H. It ',...
        'should be a symmetric positive definite matrix.']);
    
    % Then HELP field
    uicontrol( ...
        'Style','text', ...
        'Units','normalized', ...
        'Max',10, ...
        'BackgroundColor',[.9 .9 .9], ...
        'Position',[.38,.71,.55,.26], ...
        'FontSize',10, ...
        'FontUnits','normalized',...
        'HorizontalAlignment','left', ...
        'String',hlpstr);
    
    % First, the MiniCommand Window frame
    uicontrol( ...
        'Style','frame', ...
        'Units','normalized', ...
        'FontUnits','normalized',...
        'Position',[.38,0.23,.55,.47], ...
        'BackgroundColor',[0.50 0.50 0.50]);
    
    uicontrol( ...
        'Style','text', ...
        'Units','normalized', ...
        'FontUnits','normalized',...
        'Position',[.39,.64,.53,.05], ...
        'BackgroundColor',[0.50 0.50 0.50], ...
        'FontSize',0.7,...
        'String','Choosing the smoothing bandwidth');
    
    % First, the MiniCommand Window frame
    uicontrol( ...
        'Style','frame', ...
        'Units','normalized', ...
        'FontUnits','normalized',...
        'Position',[.4,0.25,.25,.37], ...
        'BackgroundColor',[0.50 0.50 0.50]);
    
    uicontrol( ...
        'Style','text', ...
        'Units','normalized', ...
        'FontUnits','normalized',...
        'Position',[.41,.56,.23,.05], ...
        'BackgroundColor',[0.50 0.50 0.50], ...
        'ForegroundColor',[1 1 1], ...
        'String','Diagonal Matrix');
    
    c1='G=get(gcf,''UserData'');H=plcv(G.X,[G.n,G.k,G.m]);hL=G.hndlList;';
    c2='for i=1:4,set(hL(i+7),''String'',sprintf(''%2.2f'',H(i)));end;zadanibivar(''prac'');';
    plcvHndl=uicontrol('Style','push','Units','normalized', ...
        'FontUnits','normalized',...
        'Position',[.43,.51,.19,.05], ...
        'Callback',[c1,c2], ...
        'Enable','off', ...
        'String','Pseudo-likelihood CV');
    
    c1='G=get(gcf,''UserData'');H=lscv_m(G.X,G.n,G.k,G.m);hL=G.hndlList;';
    c2='for i=1:4,set(hL(i+7),''String'',sprintf(''%2.2f'',H(i)));end;zadanibivar(''prac'');';
    lscvdHndl=uicontrol('Style','push','Units','normalized', ...
        'FontUnits','normalized',...
        'Position',[.43,.45,.19,.05], ...
        'Callback',[c1,c2], ...
        'Enable','off', ...
        'String','Least square CV');
    
    c1='G=get(gcf,''UserData'');H=steff_spec(G.X,G.n,G.k,G.m);hL=G.hndlList;';
    c2='for i=1:4,set(hL(i+7),''String'',sprintf(''%2.2f'',H(i)));end;zadanibivar(''prac'');';
    m1Hndl=uicontrol('Style','push','Units','normalized', ...
        'FontUnits','normalized',...
        'Position',[.43,.39,.19,.05], ...
        'Callback',[c1,c2], ...
        'Enable','off', ...
        'String','Iterative method 1');
    
    c1='G=get(gcf,''UserData'');H=hledej(G.X,G.n,G.k,G.m);hL=G.hndlList;';
    c2='for i=1:4,set(hL(i+7),''String'',sprintf(''%2.2f'',H(i)));end;zadanibivar(''prac'');';
    m2Hndl=uicontrol('Style','push','Units','normalized', ...
        'FontUnits','normalized',...
        'Position',[.43,.33,.19,.05], ...
        'Callback',[c1,c2], ...
        'Enable','off', ...
        'String','Iterative method 2');
    
    c1='G=get(gcf,''UserData'');H=amiseopt2(G.n,G.k,G.m,G.styl,length(G.X),[-Inf;-Inf],[Inf;Inf],G.dens);hL=G.hndlList;';
    c2='for i=1:4,set(hL(i+7),''String'',sprintf(''%2.2f'',H(i)));end;zadanibivar(''prac'');';
    amiseHndl=uicontrol('Style','push','Units','normalized', ...
        'FontUnits','normalized',...
        'Position',[.43,.27,.19,.05], ...
        'Callback',[c1,c2], ...
        'Enable',rozhzpus, ...
        'String','AMISE optimal');
    
    % First, the MiniCommand Window frame
    uicontrol( ...
        'Style','frame', ...
        'Units','normalized', ...
        'FontUnits','normalized',...
        'Position',[.66,0.25,.25,.37], ...
        'BackgroundColor',[0.50 0.50 0.50]);
    
    uicontrol( ...
        'Style','text', ...
        'Units','normalized', ...
        'FontUnits','normalized',...
        'Position',[.67,.56,.23,.05], ...
        'BackgroundColor',[0.50 0.50 0.50], ...
        'ForegroundColor',[1 1 1], ...
        'String','Full Matrix');
    
    c1='G=get(gcf,''UserData'');H=wand(G.X);hL=G.hndlList;';
    c2='for i=1:4,set(hL(i+7),''String'',sprintf(''%2.2f'',H(i)));end;zadanibivar(''prac'');';
    covHndl=uicontrol('Style','push','Units','normalized', ...
        'FontUnits','normalized',...
        'Position',[.69,.51,.19,.05], ...
        'Callback',[c1,c2], ...
        'String','Reference rule');
    
    c1='G=get(gcf,''UserData'');H=evolcv(0,G.X,500);hL=G.hndlList;';
    c2='for i=1:4,set(hL(i+7),''String'',sprintf(''%2.2f'',H(i)));end;zadanibivar(''prac'');';
    lscvfHndl=uicontrol('Style','push','Units','normalized', ...
        'FontUnits','normalized',...
        'Position',[.69,.45,.19,.05], ...
        'Callback',[c1,c2], ...
        'String','Least square CV');
    
    c1='G=get(gcf,''UserData'');H=msp(G.X,G.n,G.k,G.m,G.styl);hL=G.hndlList;';
    c2='for i=1:4,set(hL(i+7),''String'',sprintf(''%2.2f'',H(i)));end;zadanibivar(''prac'');';
    mspHndl=uicontrol('Style','push','Units','normalized', ...
        'FontUnits','normalized',...
        'Position',[.69,.39,.19,.05], ...
        'Callback',[c1,c2], ...
        'String','Maximal smoothing');

    c1='G=get(gcf,''UserData'');H=H_iter(G.X,0);hL=G.hndlList;';
    c2='for i=1:4,set(hL(i+7),''String'',sprintf(''%2.2f'',H(i)));end;zadanibivar(''prac'');';
    itHndl=uicontrol('Style','push','Units','normalized', ...
        'FontUnits','normalized',...
        'Position',[.69,.33,.19,.05], ...
        'Callback',[c1,c2], ...
        'String','Iterative method');

    c1='G=get(gcf,''UserData'');H=sitmise(0,length(G.X),G.mu,G.sigma,G.w);hL=G.hndlList;';
    c2='for i=1:4,set(hL(i+7),''String'',sprintf(''%2.2f'',H(i)));end;zadanibivar(''prac'');';
    miseHndl=uicontrol('Style','push','Units','normalized', ...
        'FontUnits','normalized',...
        'Position',[.69,.27,.19,.05], ...
        'Callback',[c1,c2], ...
        'Enable',rozhzpusmise,...
        'String','MISE optimal');
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    
    c1='zadanibivar(''prac'');G=get(gcf,''UserData'');drkernbivar(G.styl,G.n,G.k,G.m);';
    uicontrol('Style','push','Units','normalized', ...
        'FontUnits','normalized',...
        'Position',[.03,.05,.14,.08], ...
        'Callback',c1, ...
        'BackgroundColor',[.5,0.5,0.5], ...
        'String','Draw the kern');
    
    uicontrol('Style','push','Units','normalized', ...
        'FontUnits','normalized',...
        'Position',[.63,.05,.14,.08], ...
        'Callback',['zadanibivar(''prac'');',...
        'kfig=findobj(0,''name'',''KERNEL SMOOTHING'');set(kfig,''Visible'',''off'');', ...
        'set(kfig,''Visible'',''on'');'], ...
        'BackgroundColor',[.5,0.5,0.5], ...
        'String','OK');
    
    closeStr=['set(gcf,''CloseRequestFcn'',''closereq'');',...
        'delete(findobj(0,''Tag'',''eclos''));delete(gcf);'];
    uicontrol('Style','push','Units','normalized', ...
        'FontUnits','normalized',...
        'Position',[.79,.05,.14,.08], ...
        'Callback',closeStr, ...
        'BackgroundColor',[.5,0.5,0.5], ...
        'String','Close');
    
    set(gcf,'CloseRequestFcn',closeStr);
    
    
    
    set(nHndl,'Value',1);set(kHndl,'Value',1);
    set(mHndl,'Value',2);%set(hHndl,'String','0.1');
    %set(gcf,'Position',[0 0.0347 1.0000 0.9190]);
    set(gcf,'Position',[0.1059 0.1655 0.7700 0.6898]);
    
    G.hndlList=[nHndl kHndl mHndl rad1Hndl rad2Hndl,...
        rad3Hndl rad4Hndl h11Hndl h21Hndl h12Hndl h22Hndl symHndl psdHndl,...
        plcvHndl lscvdHndl m1Hndl m2Hndl amiseHndl,...
        covHndl lscvfHndl mspHndl itHndl miseHndl evHndl inqHndl];
    G.styl='gaus';
    
    %  prevFig=findobj(0,'name','KERNEL SMOOTHING');
    %  prevG=get(prevFig,'UserData');
    H=prevG.H;
    G.H=H;
    set(h11Hndl,'String',sprintf('%2.2f',G.H(1,1)));
    set(h12Hndl,'String',sprintf('%2.2f',G.H(1,2)));
    set(h21Hndl,'String',sprintf('%2.2f',G.H(2,1)));
    set(h22Hndl,'String',sprintf('%2.2f',G.H(2,2)));
    
    G.rozh=rozhzpus;
    G.rozhmise=rozhzpusmise;
    G.mu=prevG.mu;
    G.sigma=prevG.sigma;
    G.w=prevG.w;
    
    set(figNumber,'Visible','on', ...
        'UserData',G);
    
    zadanibivar('prac');
    
elseif strcmp(akce,'prac')
    thisFig=findobj(0,'name','EDIT');
    prevFig=findobj(0,'name','KERNEL SMOOTHING');
    prevG=get(prevFig,'UserData');
    G=get(thisFig,'UserData');
    hndlList=G.hndlList;
    nHndl=hndlList(1);
    kHndl=hndlList(2);
    mHndl=hndlList(3);
    h11Hndl=hndlList(8);
    h21Hndl=hndlList(9);
    h12Hndl=hndlList(10);
    h22Hndl=hndlList(11);
    symHndl=hndlList(12);
    psdHndl=hndlList(13);
    evHndl=hndlList(24);
    inqHndl=hndlList(25);
    G.n=get(nHndl,'Value')-1;
    G.k=get(kHndl,'Value')+1;
    G.m=get(mHndl,'Value')-1;
    G.X=prevG.X;
    G.dens=prevG.dens;
    
    h11=get(h11Hndl,'String');
    h12=get(h12Hndl,'String');
    h21=get(h21Hndl,'String');
    h22=get(h22Hndl,'String');
    H=[str2num(h11),str2num(h12);str2num(h21),str2num(h22)];
    G.H=H;
    if H(1,2)~=H(2,1)
        set(symHndl,'Visible','on','FontSize',0.4);
        set(psdHndl,'Visible','off');
    else
        set(symHndl,'Visible','off');
        vlc=eig(H);
        if min(vlc)<=0
            set(psdHndl,'Visible','on','FontSize',0.4);
        else
            set(psdHndl,'Visible','off');
        end
        
    end
    ev = G.n + G.k;
    if round(ev/2)~=(ev/2)
        set(evHndl,'Visible','on');
    else
        set(evHndl,'Visible','off');
    end
    
    if G.n>=G.k
        set(inqHndl,'Visible','on');
    else
        set(inqHndl,'Visible','off');
    end

    set(thisFig,'UserData',G);
    prevG.H=H;
    prevG.n=G.n;
    prevG.k=G.k;
    prevG.m=G.m;
    prevG.styl=G.styl;
    set(prevFig,'UserData',prevG);
end;



